344
---
title: "Advanced Dashboarding"
output:
flexdashboard::flex_dashboard:
orientation: row
vertical_layout: fill
social: ["menu"]
source_code: embed
theme:
version: 4
bootswatch: sandstone
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(palmerpenguins)
library(plotly)
library(DT)
library(fontawesome)
library(hrbrthemes)
# remotes::install_version("Rttf2pt1", version = "1.3.8")
#
# extrafont::font_import()
theme_set(theme_ft_rc())
hrbrthemes::import_roboto_condensed()
extrafont::loadfonts(device = "win")
data("penguins")
```
Plots page {data-navmenu="Navigation"}
=======================================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
### Penguins Stats
The number of penguins in the data is `r nrow(penguins)`
Row
-----------------------------------------------------------------------
### Number of penguins
```{r}
valueBox(nrow(penguins), icon = "fa-linux")
```
Column {.tabset}
-----------------------------------------------------------------------
### Chart A
```{r}
plot1 <- penguins %>%
ggplot(aes(x = bill_length_mm, y = bill_depth_mm, colour = species)) +
geom_point() +
labs(title = "Penguins scatterplot")
ggplotly(plot1)
```
### Chart B
```{r}
penguins %>%
ggplot(aes(x = body_mass_g, y = sex, fill = sex)) +
geom_boxplot() +
labs(title = "Penguins boxplot")
```
### Chart C
```{r}
penguins %>%
ggplot(aes(x = flipper_length_mm, fill = species)) +
geom_histogram() +
facet_wrap(~species) +
labs(title = "Penguins histogram") +
theme(legend.position = "none")
```
Data {data-navmenu="Navigation"}
=======================================================================
```{r}
penguins %>%
datatable(extensions = "Buttons",
options = list(dom = "Blfrtip",
buttons = c("copy", "csv", "excel", "pdf", "print"))) #B = add buttons, "lfrtip" are default
```